package org.omg.GIOP;

//
// Helper class for : MsgType_1_1
//
// @author OpenORB Compiler
//
public class MsgType_1_1Helper {
	//
	// Insert MsgType_1_1 into an any
	// @param a an any
	// @param t MsgType_1_1 value
	//
	public static void insert(org.omg.CORBA.Any a, org.omg.GIOP.MsgType_1_1 t) {
		a.type(type());
		write(a.create_output_stream(), t);
	}

	//
	// Extract MsgType_1_1 from an any
	// @param a an any
	// @return the extracted MsgType_1_1 value
	//
	public static org.omg.GIOP.MsgType_1_1 extract(org.omg.CORBA.Any a) {
		if (!a.type().equal(type()))
			throw new org.omg.CORBA.MARSHAL();
		return read(a.create_input_stream());
	}

	//
	// Internal TypeCode value
	//
	private static org.omg.CORBA.TypeCode _tc = null;

	//
	// Return the MsgType_1_1 TypeCode
	// @return a TypeCode
	//
	public static org.omg.CORBA.TypeCode type() {
		if (_tc == null) {
			org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init();
			String[] _members = new String[8];
			_members[0] = "Request";
			_members[1] = "Reply";
			_members[2] = "CancelRequest";
			_members[3] = "LocateRequest";
			_members[4] = "LocateReply";
			_members[5] = "CloseConnection";
			_members[6] = "MessageError";
			_members[7] = "Fragment";
			_tc = orb.create_enum_tc(id(), "MsgType_1_1", _members);
		}
		return _tc;
	}

	//
	// Return the MsgType_1_1 IDL ID
	// @return an ID
	//
	public static String id() {
		return _id;
	}

	private final static String _id = "IDL:omg.org/GIOP/MsgType_1_1:1.0";

	//
	// Read MsgType_1_1 from a marshalled stream
	// @param istream the input stream
	// @return the readed MsgType_1_1 value
	//
	public static org.omg.GIOP.MsgType_1_1 read(
			org.omg.CORBA.portable.InputStream istream) {
		return MsgType_1_1.from_int(istream.read_ulong());
	}

	//
	// Write MsgType_1_1 into a marshalled stream
	// @param ostream the output stream
	// @param value MsgType_1_1 value
	//
	public static void write(org.omg.CORBA.portable.OutputStream ostream,
			org.omg.GIOP.MsgType_1_1 value) {
		ostream.write_ulong(value.value());
	}

}
